<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../res/plugins/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="../../res/plugins/datatable/css/dataTables.bootstrap.css"/>
    <link rel="stylesheet" href="../../res/plugins/datatable/extensions/FixedHeader/css/fixedHeader.bootstrap.css">
</head>
<body>

<div style="width:80%;margin: 20px auto;">
    <table id="example" class="display" cellspacing="0" width="100%">
        <thead>
        <tr>
            <th>First name</th>
            <th>Last name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Start date</th>
            <th>Salary</th>
        </tr>
        </thead>
        <tfoot>
        <tr>
            <th>First name</th>
            <th>Last name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Start date</th>
            <th>Salary</th>
        </tr>
        </tfoot>
    </table>
</div>

<div class="row">
    <div class="col-md-2">1</div>
    <div class="col-md-3">2</div>
    <div class="col-md-7">3</div>
</div>
<div id="pageInfo"></div>
<div>
    <input type="text" id="jumpInput"/>
    <button id="jumpBtn">Go</button>
</div>

<script id="operationBtn" type="text/html">
    <div class="operation-wrapper">
        <a href="javascript:;"class="btn btn-link btn-sm detail">
            <span class="glyphicon glyphicon-search" aria-hidden="true"></span> 查看
        </a>
        <a href="javascript:;"class="btn btn-link btn-sm update">
            <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 修改
        </a>
        <div class="dropdown inline-block">
            <a href="javascript:;" class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown">
                更多 <span class="caret"></span>
            </a>
            <ul class="dropdown-menu">
                <li><a href="#">导出</a></li>
                <li><a href="#">拨打电话</a></li>
                <li><a href="#">联系人信息</a></li>
            </ul>
        </div>
    </div>
</script>


<div style="height: 300px;"></div>
    <style>
        .inline-block{
            display: inline-block;
        }
        div.operation-wrapper{
            white-space: nowrap;
        }

        div.operation-wrapper a.btn{
            padding-left: 3px;
            padding-right: 3px;
        }
    </style>
    <script src="../../res/plugins/jquery/jquery-2.2.0.min.js"></script>
    <script src="../../res/plugins/bootstrap/js/bootstrap.js"></script>
    <script src="../../res/plugins/datatable/js/jquery.dataTables.js"></script>
    <script src="../../res/plugins/datatable/js/dataTables.bootstrap.js"></script>
    <script src="../../res/plugins/datatable/extensions/FixedHeader/js/dataTables.fixedHeader.js"></script>


    <script>


        $(document).ready(function() {
            $('#example').DataTable( {
                "processing": true,
                "serverSide": true,
                "ajax": {
                    "url": "data.json",
                    "type": "POST",
                    "dataSrc": function ( json ) {
                        console.log(json);
                        return json.data;
                    }
                },
                "columns": [
                    { "data": "first_name" },
                    { "data": "last_name" },
                    { "data": "position" },
                    { "data": "office" },
                    { "data": "start_date" },
                    { "data": "salary" }
                ]
            } );
        } );
    </script>
</body>
</html>